package com.mk.admin.controller;

import com.mk.admin.model.ResultDto;
import com.mk.admin.model.query.MedicalTechnologyReportQuery;
import com.mk.admin.model.query.MedicalTechnologyReportResultRemoteQuery;
import com.mk.admin.model.vo.MedicalTechnologyReportRemoteVo;
import com.mk.admin.model.vo.MedicalTechnologyReportVo;
import com.mk.admin.service.MedicalTechnologyReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "检验检查报告")
@RequestMapping("/a/adm/medicalTechnologyReport")
public class MedicalTechnologyReportController {
    @Autowired
    private MedicalTechnologyReportService medicalTechnologyReportService;

    @PostMapping("/select")
    public ResultDto select(@RequestBody MedicalTechnologyReportQuery medicalTechnologyReportQuery) {
        return medicalTechnologyReportService.select(medicalTechnologyReportQuery);
    }

    @PostMapping("/check")
    @ApiOperation(value = "com_0003检查报告查询刷新", notes = "queryType 1 就诊卡2 社保卡\n" +
            "3 健康卡号4 身份证号\n" +
            "5 门诊病历号6 姓名\n" +
            "7 手机号8 门诊patId\n" +
            "9 发票号（需要his）\n" +
            "10港澳证件号\n" +
            "11台湾证件号\n" +
            "12护照号码\n" +
            "13住院门诊号\n" +
            "14门诊就诊号\n" +
            "15住院病历号\n" +
            "16住院patId，17挂号ID\n" +
            "queryValue beginTime endTime yyyy-MM-dd HH:mm:ss")
    public ResultDto check(@RequestBody MedicalTechnologyReportRemoteVo vo) {
        return medicalTechnologyReportService.check(vo);
    }

    @PostMapping("/checkResult")
    @ApiOperation("com_0005检查报告详细")
    public ResultDto checkResult(@RequestBody MedicalTechnologyReportResultRemoteQuery query) {
        return medicalTechnologyReportService.checkResult(query);
    }

    @PostMapping("/test")
    @ApiOperation(value = "com_0004检验报告查询刷新", notes = "queryType 1 就诊卡2 社保卡\n" +
            "3 健康卡号4 身份证号\n" +
            "5 门诊病历号6 姓名\n" +
            "7 手机号8 门诊patId\n" +
            "9 发票号（需要his）\n" +
            "10港澳证件号\n" +
            "11台湾证件号\n" +
            "12护照号码\n" +
            "13住院门诊号\n" +
            "14门诊就诊号\n" +
            "15住院病历号\n" +
            "16住院patId，17挂号ID\n" +
            "queryValue beginTime endTime yyyy-MM-dd HH:mm:ss")
    public ResultDto test(@RequestBody MedicalTechnologyReportRemoteVo vo) {
        return medicalTechnologyReportService.test(vo);
    }

    @PostMapping("/testResult")
    @ApiOperation("com_0006检验报告详细")
    public ResultDto testResult(@RequestBody MedicalTechnologyReportResultRemoteQuery query) {
        return medicalTechnologyReportService.testResult(query);
    }

    @PostMapping("/add")
    public ResultDto add(@RequestBody MedicalTechnologyReportVo medicalTechnologyReportVo) {
        return medicalTechnologyReportService.add(medicalTechnologyReportVo);
    }

<<<<<<< HEAD
    @PostMapping("/udpate")
=======
    @PostMapping("/update")
>>>>>>> f2106939b942a7ac2c3470910120a35364fbfaac
    public ResultDto update(@RequestBody MedicalTechnologyReportVo medicalTechnologyReportVo) {
        return medicalTechnologyReportService.update(medicalTechnologyReportVo);
    }

    @PostMapping("/delete")
    public ResultDto delete(@RequestBody MedicalTechnologyReportVo medicalTechnologyReportVo) {
        return medicalTechnologyReportService.delete(medicalTechnologyReportVo.getId());
    }

    @PostMapping("/status")
    public ResultDto status(@RequestBody MedicalTechnologyReportVo medicalTechnologyReportVo) {
        return medicalTechnologyReportService.status(medicalTechnologyReportVo.getId());
    }
}
